package com.springboot.study.tests.supplier;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.function.Supplier;

/**
 * @Author: guodong
 * @Date: 2020/11/26 10:28
 * @Version: 1.0
 * @Description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Person {

    private String name;

    public static Person create(Supplier<Person> sup){
        return sup.get();
    }

    public void run(){
        System.out.println(name + " is running");
    }


}
